<template>
  <div class="list-table">
    <el-tabs v-model="view" @tab-click="clickHandle">
      <el-tab-pane :label="$t('科目信息')" name="pcwTempSysDetailsList" />
      <el-tab-pane :label="$t('关键指标')" name="pcwTempSysKeyList" />
      <el-tab-pane :label="$t('科目校验')" name="pcwSysSubjectValidation" />
    </el-tabs>

    <div v-if="view==='pcwTempSysKeyList'" class="contentKey">
      <pcwTempSysKeyList :type-id="typeId" />
    </div>
    <div v-if="view==='pcwTempSysDetailsList'" class="contentKey">
      <pcwTempSysDetailsList :type-id="typeId" />
    </div>
    <div v-if="view==='pcwSysSubjectValidation'" class="contentKey">
      <pcw-sys-subject-validation-list ref="pcwSysSubjectValidation" :type-id="typeId" />
    </div>
  </div>
</template>

<script>
import pcwTempSysKeyList from './pcwTempSysKeyList.vue'
import pcwTempSysDetailsList from './pcwTempSysSubjectList.vue'
import PcwSysSubjectValidationList from '@/views/company/pcw/pcwSysSubjectValidationList'
export default {
  name: 'PcwSysTabs',
    components: {
      PcwSysSubjectValidationList,
      pcwTempSysKeyList,
      pcwTempSysDetailsList
    },
  props: {
    typeId: {
      type: String,
      default: ''
    }
  },
  data() {
      return {
          // 遮罩层
          loading: true,
          // 视图
          view: 'pcwTempSysDetailsList'
      }
  },
  methods: {
    init() {
      this.view = 'pcwTempSysDetailsList'
    },
    clickHandle() {
      if (this.view === 'pcwSysSubjectValidation') {
        this.$nextTick(() => {
          this.$refs.pcwSysSubjectValidation.getList()
        })
      }
    }
  }
}
</script>
